<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // 中文编码   只针对中文和空格和符号
        //   编码   encodeURIComponent()
        //   解码   decodeURIComponent()


        let str = '呵呵呵?,hello123,';
        console.log(encodeURIComponent(str));

        let str2 = '%E5%91%B5%E5%91%B5%E5%91%B5%20hello';
        console.log(decodeURIComponent(str2));


    </script>

</body>

</html>